popsize = 2;
headsize = 3;

[head,out] = readData('/Users/Alex/Documents/Dev/Ecplise_Workspace/QuasiSpecies/Debug/out.dat',headsize,4);
x = linspace(0,max(out(:,1)),max(out(:,1))+1);
y = linspace(0,max(out(:,2)),max(out(:,2))+1);

pops = {zeros(length(y),length(x)),zeros(length(y),length(x))};
for i=1:popsize,
    z = reshape(out(:,2+i),size(y,2),size(x,2));
    pops(i)={z};
end

var1 = pops{1}(256,:);
var2 = pops{2}(256,:);

save /Users/Alex/Documents/Dev/Ecplise_Workspace/QuasiSpecies/Debug/vir.out  var1 -ASCII;
save /Users/Alex/Documents/Dev/Ecplise_Workspace/QuasiSpecies/Debug/is.out  var2 -ASCII;

'Done saving datafiles'